<template>
  <el-row :gutter="24">
    <el-col :span="8">
      <el-card shadow="never" :class="['overflow-card', computedClass('card1')]">
        <div slot="header" style="text-align: center">
          <span>考评方</span>
        </div>
        <ul ref="card1">
          <li
            class="mb20"
            v-for="(item,index) in mdl.internalPlanExecutorList"
            :key="index"
          >{{ index + 1 + '.' }}{{item.name}}</li>
        </ul>
      </el-card>
    </el-col>
    <el-col :span="8">
      <el-card shadow="never" :class="['overflow-card', computedClass('card2')]">
        <div slot="header" style="text-align: center">
          <span>考评等级</span>
        </div>
        <ul ref="card2">
          <li
            class="mb20"
            v-for="(item,index) in mdl.internalPlanLevelList"
            :key="index"
          >{{ index + 1 + '.' }}{{item.internalLevelName}}</li>
        </ul>
      </el-card>
    </el-col>
    <el-col :span="8" v-show="mdl.internalPlanTargetList && mdl.internalPlanTargetList.length > 0">
      <el-card shadow="never" :class="['overflow-card', computedClass('card3')]">
        <div slot="header" style="text-align: center">
          <span>被考评方</span>
        </div>
        <ul ref="card3">
          <li
            class="mb20"
            v-for="(item,index) in mdl.internalPlanTargetList"
            :key="index"
          >{{ index + 1 + '.' }}{{item.name}}</li>
        </ul>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
export default {
  data() {
    return {
      mdl: {}
    }
  },
  methods: {
    computedClass(ref) {
      this.$nextTick(() => {
        // console.log('offsetHeight', this.$refs[ref])
        return { 'overflow-card': true, 'overY-Scroll': this.$refs[ref].offsetHeight > 310 }
      })
    },
    show(obj) {
      console.log(obj)
      this.mdl = obj
    }
  }
}
</script>
